package com.fitns.user.mapper.baseConfig;

import static org.mybatis.dynamic.sql.SqlBuilder.*;

import com.fitns.user.model.baseConfig.TbGarbageBurnData;

import java.util.List;
import javax.annotation.Generated;

import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.mybatis.dynamic.sql.SqlBuilder;
import org.mybatis.dynamic.sql.delete.DeleteDSL;
import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter;
import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider;
import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider;
import org.mybatis.dynamic.sql.render.RenderingStrategy;
import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter;
import org.mybatis.dynamic.sql.select.QueryExpressionDSL;
import org.mybatis.dynamic.sql.select.SelectDSL;
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter;
import org.mybatis.dynamic.sql.update.UpdateDSL;
import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider;
import org.mybatis.dynamic.sql.util.SqlProviderAdapter;

@Mapper
public interface TbGarbageBurnDataMapper {
    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    @SelectProvider(type=SqlProviderAdapter.class, method="select")
    long count(SelectStatementProvider selectStatement);

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
    int delete(DeleteStatementProvider deleteStatement);

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    @InsertProvider(type=SqlProviderAdapter.class, method="insert")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
    int insert(InsertStatementProvider<TbGarbageBurnData> insertStatement);

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    @SelectProvider(type=SqlProviderAdapter.class, method="select")
    @ResultMap("TbGarbageBurnDataResult")
    TbGarbageBurnData selectOne(SelectStatementProvider selectStatement);

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    @SelectProvider(type=SqlProviderAdapter.class, method="select")
    @Results(id="TbGarbageBurnDataResult", value = {
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="organ_id", property="organId", jdbcType=JdbcType.BIGINT),
        @Result(column="status", property="status", jdbcType=JdbcType.VARCHAR),
        @Result(column="acreage", property="acreage", jdbcType=JdbcType.VARCHAR),
        @Result(column="counter", property="counter", jdbcType=JdbcType.VARCHAR),
        @Result(column="population", property="population", jdbcType=JdbcType.INTEGER),
        @Result(column="liabler", property="liabler", jdbcType=JdbcType.VARCHAR),
        @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
        @Result(column="terminal", property="terminal", jdbcType=JdbcType.VARCHAR),
        @Result(column="rfid", property="rfid", jdbcType=JdbcType.VARCHAR),
        @Result(column="descs", property="descs", jdbcType=JdbcType.VARCHAR),
        @Result(column= "image", property= "image", jdbcType=JdbcType.VARCHAR),
        @Result(column="begin_time", property="beginTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="input_time", property="inputTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="modify_time", property="modifyTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_id", property="createId", jdbcType=JdbcType.BIGINT),
        @Result(column="modify_d", property="modifyD", jdbcType=JdbcType.BIGINT)
    })
    List<TbGarbageBurnData> selectMany(SelectStatementProvider selectStatement);

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    @UpdateProvider(type=SqlProviderAdapter.class, method="update")
    int update(UpdateStatementProvider updateStatement);

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
        return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
                .from(TbGarbageBurnDataDynamicSqlSupport.tbGarbageBurnData);
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
        return DeleteDSL.deleteFromWithMapper(this::delete, TbGarbageBurnDataDynamicSqlSupport.tbGarbageBurnData);
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default int deleteByPrimaryKey(Long id_) {
        return DeleteDSL.deleteFromWithMapper(this::delete, TbGarbageBurnDataDynamicSqlSupport.tbGarbageBurnData)
                .where(TbGarbageBurnDataDynamicSqlSupport.id, isEqualTo(id_))
                .build()
                .execute();
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default int insert(TbGarbageBurnData record) {
        return insert(SqlBuilder.insert(record)
                .into(TbGarbageBurnDataDynamicSqlSupport.tbGarbageBurnData)
                .map(TbGarbageBurnDataDynamicSqlSupport.name).toProperty("name")
                .map(TbGarbageBurnDataDynamicSqlSupport.organId).toProperty("organId")
                .map(TbGarbageBurnDataDynamicSqlSupport.status).toProperty("status")
                .map(TbGarbageBurnDataDynamicSqlSupport.acreage).toProperty("acreage")
                .map(TbGarbageBurnDataDynamicSqlSupport.counter).toProperty("counter")
                .map(TbGarbageBurnDataDynamicSqlSupport.population).toProperty("population")
                .map(TbGarbageBurnDataDynamicSqlSupport.liabler).toProperty("liabler")
                .map(TbGarbageBurnDataDynamicSqlSupport.phone).toProperty("phone")
                .map(TbGarbageBurnDataDynamicSqlSupport.terminal).toProperty("terminal")
                .map(TbGarbageBurnDataDynamicSqlSupport.rfid).toProperty("rfid")
                .map(TbGarbageBurnDataDynamicSqlSupport.descs).toProperty("descs")
                .map(TbGarbageBurnDataDynamicSqlSupport.image).toProperty("image")
                .map(TbGarbageBurnDataDynamicSqlSupport.beginTime).toProperty("beginTime")
                .map(TbGarbageBurnDataDynamicSqlSupport.inputTime).toProperty("inputTime")
                .map(TbGarbageBurnDataDynamicSqlSupport.modifyTime).toProperty("modifyTime")
                .map(TbGarbageBurnDataDynamicSqlSupport.createId).toProperty("createId")
                .map(TbGarbageBurnDataDynamicSqlSupport.modifyD).toProperty("modifyD")
                .build()
                .render(RenderingStrategy.MYBATIS3));
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default int insertSelective(TbGarbageBurnData record) {
        return insert(SqlBuilder.insert(record)
                .into(TbGarbageBurnDataDynamicSqlSupport.tbGarbageBurnData)
                .map(TbGarbageBurnDataDynamicSqlSupport.name).toPropertyWhenPresent("name", record::getName)
                .map(TbGarbageBurnDataDynamicSqlSupport.organId).toPropertyWhenPresent("organId", record::getOrganId)
                .map(TbGarbageBurnDataDynamicSqlSupport.status).toPropertyWhenPresent("status", record::getStatus)
                .map(TbGarbageBurnDataDynamicSqlSupport.acreage).toPropertyWhenPresent("acreage", record::getAcreage)
                .map(TbGarbageBurnDataDynamicSqlSupport.counter).toPropertyWhenPresent("counter", record::getCounter)
                .map(TbGarbageBurnDataDynamicSqlSupport.population).toPropertyWhenPresent("population", record::getPopulation)
                .map(TbGarbageBurnDataDynamicSqlSupport.liabler).toPropertyWhenPresent("liabler", record::getLiabler)
                .map(TbGarbageBurnDataDynamicSqlSupport.phone).toPropertyWhenPresent("phone", record::getPhone)
                .map(TbGarbageBurnDataDynamicSqlSupport.terminal).toPropertyWhenPresent("terminal", record::getTerminal)
                .map(TbGarbageBurnDataDynamicSqlSupport.rfid).toPropertyWhenPresent("rfid", record::getRfid)
                .map(TbGarbageBurnDataDynamicSqlSupport.descs).toPropertyWhenPresent("descs", record::getDescs)
                .map(TbGarbageBurnDataDynamicSqlSupport.image).toPropertyWhenPresent("image", record::getImage)
                .map(TbGarbageBurnDataDynamicSqlSupport.beginTime).toPropertyWhenPresent("beginTime", record::getBeginTime)
                .map(TbGarbageBurnDataDynamicSqlSupport.inputTime).toPropertyWhenPresent("inputTime", record::getInputTime)
                .map(TbGarbageBurnDataDynamicSqlSupport.modifyTime).toPropertyWhenPresent("modifyTime", record::getModifyTime)
                .map(TbGarbageBurnDataDynamicSqlSupport.createId).toPropertyWhenPresent("createId", record::getCreateId)
                .map(TbGarbageBurnDataDynamicSqlSupport.modifyD).toPropertyWhenPresent("modifyD", record::getModifyD)
                .build()
                .render(RenderingStrategy.MYBATIS3));
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<TbGarbageBurnData>>> selectByExample() {
        return SelectDSL.selectWithMapper(this::selectMany, TbGarbageBurnDataDynamicSqlSupport.id, TbGarbageBurnDataDynamicSqlSupport.name, TbGarbageBurnDataDynamicSqlSupport.organId, TbGarbageBurnDataDynamicSqlSupport.status, TbGarbageBurnDataDynamicSqlSupport.acreage, TbGarbageBurnDataDynamicSqlSupport.counter, TbGarbageBurnDataDynamicSqlSupport.population, TbGarbageBurnDataDynamicSqlSupport.liabler, TbGarbageBurnDataDynamicSqlSupport.phone, TbGarbageBurnDataDynamicSqlSupport.terminal, TbGarbageBurnDataDynamicSqlSupport.rfid, TbGarbageBurnDataDynamicSqlSupport.descs, TbGarbageBurnDataDynamicSqlSupport.image, TbGarbageBurnDataDynamicSqlSupport.beginTime, TbGarbageBurnDataDynamicSqlSupport.inputTime, TbGarbageBurnDataDynamicSqlSupport.modifyTime, TbGarbageBurnDataDynamicSqlSupport.createId, TbGarbageBurnDataDynamicSqlSupport.modifyD)
                .from(TbGarbageBurnDataDynamicSqlSupport.tbGarbageBurnData);
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<TbGarbageBurnData>>> selectDistinctByExample() {
        return SelectDSL.selectDistinctWithMapper(this::selectMany, TbGarbageBurnDataDynamicSqlSupport.id, TbGarbageBurnDataDynamicSqlSupport.name, TbGarbageBurnDataDynamicSqlSupport.organId, TbGarbageBurnDataDynamicSqlSupport.status, TbGarbageBurnDataDynamicSqlSupport.acreage, TbGarbageBurnDataDynamicSqlSupport.counter, TbGarbageBurnDataDynamicSqlSupport.population, TbGarbageBurnDataDynamicSqlSupport.liabler, TbGarbageBurnDataDynamicSqlSupport.phone, TbGarbageBurnDataDynamicSqlSupport.terminal, TbGarbageBurnDataDynamicSqlSupport.rfid, TbGarbageBurnDataDynamicSqlSupport.descs, TbGarbageBurnDataDynamicSqlSupport.image, TbGarbageBurnDataDynamicSqlSupport.beginTime, TbGarbageBurnDataDynamicSqlSupport.inputTime, TbGarbageBurnDataDynamicSqlSupport.modifyTime, TbGarbageBurnDataDynamicSqlSupport.createId, TbGarbageBurnDataDynamicSqlSupport.modifyD)
                .from(TbGarbageBurnDataDynamicSqlSupport.tbGarbageBurnData);
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default TbGarbageBurnData selectByPrimaryKey(Long id_) {
        return SelectDSL.selectWithMapper(this::selectOne, TbGarbageBurnDataDynamicSqlSupport.id, TbGarbageBurnDataDynamicSqlSupport.name, TbGarbageBurnDataDynamicSqlSupport.organId, TbGarbageBurnDataDynamicSqlSupport.status, TbGarbageBurnDataDynamicSqlSupport.acreage, TbGarbageBurnDataDynamicSqlSupport.counter, TbGarbageBurnDataDynamicSqlSupport.population, TbGarbageBurnDataDynamicSqlSupport.liabler, TbGarbageBurnDataDynamicSqlSupport.phone, TbGarbageBurnDataDynamicSqlSupport.terminal, TbGarbageBurnDataDynamicSqlSupport.rfid, TbGarbageBurnDataDynamicSqlSupport.descs, TbGarbageBurnDataDynamicSqlSupport.image, TbGarbageBurnDataDynamicSqlSupport.beginTime, TbGarbageBurnDataDynamicSqlSupport.inputTime, TbGarbageBurnDataDynamicSqlSupport.modifyTime, TbGarbageBurnDataDynamicSqlSupport.createId, TbGarbageBurnDataDynamicSqlSupport.modifyD)
                .from(TbGarbageBurnDataDynamicSqlSupport.tbGarbageBurnData)
                .where(TbGarbageBurnDataDynamicSqlSupport.id, isEqualTo(id_))
                .build()
                .execute();
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(TbGarbageBurnData record) {
        return UpdateDSL.updateWithMapper(this::update, TbGarbageBurnDataDynamicSqlSupport.tbGarbageBurnData)
                .set(TbGarbageBurnDataDynamicSqlSupport.name).equalTo(record::getName)
                .set(TbGarbageBurnDataDynamicSqlSupport.organId).equalTo(record::getOrganId)
                .set(TbGarbageBurnDataDynamicSqlSupport.status).equalTo(record::getStatus)
                .set(TbGarbageBurnDataDynamicSqlSupport.acreage).equalTo(record::getAcreage)
                .set(TbGarbageBurnDataDynamicSqlSupport.counter).equalTo(record::getCounter)
                .set(TbGarbageBurnDataDynamicSqlSupport.population).equalTo(record::getPopulation)
                .set(TbGarbageBurnDataDynamicSqlSupport.liabler).equalTo(record::getLiabler)
                .set(TbGarbageBurnDataDynamicSqlSupport.phone).equalTo(record::getPhone)
                .set(TbGarbageBurnDataDynamicSqlSupport.terminal).equalTo(record::getTerminal)
                .set(TbGarbageBurnDataDynamicSqlSupport.rfid).equalTo(record::getRfid)
                .set(TbGarbageBurnDataDynamicSqlSupport.descs).equalTo(record::getDescs)
                .set(TbGarbageBurnDataDynamicSqlSupport.image).equalTo(record::getImage)
                .set(TbGarbageBurnDataDynamicSqlSupport.beginTime).equalTo(record::getBeginTime)
                .set(TbGarbageBurnDataDynamicSqlSupport.inputTime).equalTo(record::getInputTime)
                .set(TbGarbageBurnDataDynamicSqlSupport.modifyTime).equalTo(record::getModifyTime)
                .set(TbGarbageBurnDataDynamicSqlSupport.createId).equalTo(record::getCreateId)
                .set(TbGarbageBurnDataDynamicSqlSupport.modifyD).equalTo(record::getModifyD);
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(TbGarbageBurnData record) {
        return UpdateDSL.updateWithMapper(this::update, TbGarbageBurnDataDynamicSqlSupport.tbGarbageBurnData)
                .set(TbGarbageBurnDataDynamicSqlSupport.name).equalToWhenPresent(record::getName)
                .set(TbGarbageBurnDataDynamicSqlSupport.organId).equalToWhenPresent(record::getOrganId)
                .set(TbGarbageBurnDataDynamicSqlSupport.status).equalToWhenPresent(record::getStatus)
                .set(TbGarbageBurnDataDynamicSqlSupport.acreage).equalToWhenPresent(record::getAcreage)
                .set(TbGarbageBurnDataDynamicSqlSupport.counter).equalToWhenPresent(record::getCounter)
                .set(TbGarbageBurnDataDynamicSqlSupport.population).equalToWhenPresent(record::getPopulation)
                .set(TbGarbageBurnDataDynamicSqlSupport.liabler).equalToWhenPresent(record::getLiabler)
                .set(TbGarbageBurnDataDynamicSqlSupport.phone).equalToWhenPresent(record::getPhone)
                .set(TbGarbageBurnDataDynamicSqlSupport.terminal).equalToWhenPresent(record::getTerminal)
                .set(TbGarbageBurnDataDynamicSqlSupport.rfid).equalToWhenPresent(record::getRfid)
                .set(TbGarbageBurnDataDynamicSqlSupport.descs).equalToWhenPresent(record::getDescs)
                .set(TbGarbageBurnDataDynamicSqlSupport.image).equalToWhenPresent(record::getImage)
                .set(TbGarbageBurnDataDynamicSqlSupport.beginTime).equalToWhenPresent(record::getBeginTime)
                .set(TbGarbageBurnDataDynamicSqlSupport.inputTime).equalToWhenPresent(record::getInputTime)
                .set(TbGarbageBurnDataDynamicSqlSupport.modifyTime).equalToWhenPresent(record::getModifyTime)
                .set(TbGarbageBurnDataDynamicSqlSupport.createId).equalToWhenPresent(record::getCreateId)
                .set(TbGarbageBurnDataDynamicSqlSupport.modifyD).equalToWhenPresent(record::getModifyD);
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default int updateByPrimaryKey(TbGarbageBurnData record) {
        return UpdateDSL.updateWithMapper(this::update, TbGarbageBurnDataDynamicSqlSupport.tbGarbageBurnData)
                .set(TbGarbageBurnDataDynamicSqlSupport.name).equalTo(record::getName)
                .set(TbGarbageBurnDataDynamicSqlSupport.organId).equalTo(record::getOrganId)
                .set(TbGarbageBurnDataDynamicSqlSupport.status).equalTo(record::getStatus)
                .set(TbGarbageBurnDataDynamicSqlSupport.acreage).equalTo(record::getAcreage)
                .set(TbGarbageBurnDataDynamicSqlSupport.counter).equalTo(record::getCounter)
                .set(TbGarbageBurnDataDynamicSqlSupport.population).equalTo(record::getPopulation)
                .set(TbGarbageBurnDataDynamicSqlSupport.liabler).equalTo(record::getLiabler)
                .set(TbGarbageBurnDataDynamicSqlSupport.phone).equalTo(record::getPhone)
                .set(TbGarbageBurnDataDynamicSqlSupport.terminal).equalTo(record::getTerminal)
                .set(TbGarbageBurnDataDynamicSqlSupport.rfid).equalTo(record::getRfid)
                .set(TbGarbageBurnDataDynamicSqlSupport.descs).equalTo(record::getDescs)
                .set(TbGarbageBurnDataDynamicSqlSupport.image).equalTo(record::getImage)
                .set(TbGarbageBurnDataDynamicSqlSupport.beginTime).equalTo(record::getBeginTime)
                .set(TbGarbageBurnDataDynamicSqlSupport.inputTime).equalTo(record::getInputTime)
                .set(TbGarbageBurnDataDynamicSqlSupport.modifyTime).equalTo(record::getModifyTime)
                .set(TbGarbageBurnDataDynamicSqlSupport.createId).equalTo(record::getCreateId)
                .set(TbGarbageBurnDataDynamicSqlSupport.modifyD).equalTo(record::getModifyD)
                .where(TbGarbageBurnDataDynamicSqlSupport.id, isEqualTo(record::getId))
                .build()
                .execute();
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default int updateByPrimaryKeySelective(TbGarbageBurnData record) {
        return UpdateDSL.updateWithMapper(this::update, TbGarbageBurnDataDynamicSqlSupport.tbGarbageBurnData)
                .set(TbGarbageBurnDataDynamicSqlSupport.name).equalToWhenPresent(record::getName)
                .set(TbGarbageBurnDataDynamicSqlSupport.organId).equalToWhenPresent(record::getOrganId)
                .set(TbGarbageBurnDataDynamicSqlSupport.status).equalToWhenPresent(record::getStatus)
                .set(TbGarbageBurnDataDynamicSqlSupport.acreage).equalToWhenPresent(record::getAcreage)
                .set(TbGarbageBurnDataDynamicSqlSupport.counter).equalToWhenPresent(record::getCounter)
                .set(TbGarbageBurnDataDynamicSqlSupport.population).equalToWhenPresent(record::getPopulation)
                .set(TbGarbageBurnDataDynamicSqlSupport.liabler).equalToWhenPresent(record::getLiabler)
                .set(TbGarbageBurnDataDynamicSqlSupport.phone).equalToWhenPresent(record::getPhone)
                .set(TbGarbageBurnDataDynamicSqlSupport.terminal).equalToWhenPresent(record::getTerminal)
                .set(TbGarbageBurnDataDynamicSqlSupport.rfid).equalToWhenPresent(record::getRfid)
                .set(TbGarbageBurnDataDynamicSqlSupport.descs).equalToWhenPresent(record::getDescs)
                .set(TbGarbageBurnDataDynamicSqlSupport.image).equalToWhenPresent(record::getImage)
                .set(TbGarbageBurnDataDynamicSqlSupport.beginTime).equalToWhenPresent(record::getBeginTime)
                .set(TbGarbageBurnDataDynamicSqlSupport.inputTime).equalToWhenPresent(record::getInputTime)
                .set(TbGarbageBurnDataDynamicSqlSupport.modifyTime).equalToWhenPresent(record::getModifyTime)
                .set(TbGarbageBurnDataDynamicSqlSupport.createId).equalToWhenPresent(record::getCreateId)
                .set(TbGarbageBurnDataDynamicSqlSupport.modifyD).equalToWhenPresent(record::getModifyD)
                .where(TbGarbageBurnDataDynamicSqlSupport.id, isEqualTo(record::getId))
                .build()
                .execute();
    }
}